/**
 * Copyright (c) 2018, dreamkaylee@foxmail.com All Rights Reserved.
 */

package com.common.util;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * Exception工具类
 * @author limk
 * @date 2018年2月13日 下午12:03:50
 * @version 1.0
 */
public class ExceptionUtil {

	/**
	 * 返回错误信息字符串
	 * @param ex
	 * @return
	 */
	public static String getExceptionMessage(Exception ex) {
		StringWriter sw = new StringWriter();
		PrintWriter pw = new PrintWriter(sw);
		ex.printStackTrace(pw);
		return sw.toString();
	}

}
